/*! jQuery v3.2.1 | (c) JS Foundation and other contributors | jquery.org/license */

/*导航*/

//导航
$(function(){
    $(".nav_list").css("left",sessionStorage.left+"px");
    $(".nav_list li").each(function(){
        if($(this).find("a").text()==sessionStorage.pagecount){
            $(".sideline").css({left:$(this).position().left});
            $(".sideline").css({width:$(this).outerWidth()});
            $(this).addClass("nav_cur").siblings().removeClass("nav_cur");
            navName(sessionStorage.pagecount);
            return false
        }
        else{
            $(".sideline").css({left:0});
            $(".nav_list li").eq(0).addClass("nav_cur").siblings().removeClass("nav_cur");
        }
    });
    var nav_w=$(".nav_list li").first().width();
    $(".sideline").width(nav_w);
    $(".nav_list li").on('click', function(){
        nav_w=$(this).width();
        $(".sideline").stop(true);
        $(".sideline").animate({left:$(this).position().left},300);
        $(".sideline").animate({width:nav_w});
        $(this).addClass("nav_cur").siblings().removeClass("nav_cur");
        var fn_w = ($(".nav").width() - nav_w) / 2;
        var fnl_l;
        var fnl_x = parseInt($(this).position().left);
        if (fnl_x <= fn_w) {
            fnl_l = 0;
        }else {
            fnl_l = fn_w - fnl_x;
        }
        $(".nav_list").animate({
            "left" : fnl_l
        }, 300);
        sessionStorage.left=fnl_l;
        var c_nav=$(this).find("a").text();
        navName(c_nav);
    });
    var fl_w=$(".nav_list").width();
    $(".nav_list").on('touchstart', function (e) {
        var touch1 = e.originalEvent.targetTouches[0];
        x1 = touch1.pageX;
        y1 = touch1.pageY;
        ty_left = parseInt($(this).css("left"));
    });
    $(".nav_list").on('touchmove', function (e) {
        var touch2 = e.originalEvent.targetTouches[0];
        var x2 = touch2.pageX;
        var y2 = touch2.pageY;
        if(ty_left + x2 - x1>=0){
            $(this).css("left", 0);
        }else{
            $(this).css("left", ty_left + x2 - x1);
        }
        if(Math.abs(y2-y1)>0){
            e.preventDefault();
        }
    });
	$("#neirong_1_1").click(function(){
		
		$("#b1").show();
		$("#b2").hide();
		$(this).css({color:"#000","border-bottom":"solid 2px #0080FF"});
		$("#neirong_1_2").css({color:"#5B5B5B","border-bottom":"0"});
		
	});
	$("#neirong_1_2").click(function(){
		$("#b2").show();
		$("#b1").hide();
		$(this).css({color:"#000","border-bottom":"solid 2px #0080FF"});
		$("#neirong_1_1").css({color:"#5B5B5B","border-bottom":"0"});
		
	});
	$("#neirong_1_1").mouseover(function(){
		if($("#b1").is(":hidden")){
			$(this).css({color:"#000","border-bottom":"solid 2px #0080FF"});
		}
	});
	$("#neirong_1_1").mouseleave(function(){
		if($("#b1").is(":hidden")){
			$(this).css({color:"#5B5B5B","border-bottom":"0"});
		}
	});
	$("#neirong_1_2").mouseover(function(){
		if($("#b2").is(":hidden")){
			$(this).css({color:"#000","border-bottom":"solid 2px #0080FF"});
		}
	});
	$("#neirong_1_2").mouseleave(function(){
		if($("#b2").is(":hidden")){
			$(this).css({color:"#5B5B5B","border-bottom":"0"});
		}
	});
});
function navName(c_nav) {
    switch (c_nav) {
        case "首页":
            sessionStorage.pagecount = "首页";
            break;
        case "影院":
            sessionStorage.pagecount = "影院";
            break;

    }
}

//选择地区
function a(){
    var a1 = document.getElementById("a1");
    var b1 = document.getElementById("b1");
    var c1 = document.getElementById("c1");
    var d1 = document.getElementById("d1");
    a1.style.display="block";
    b1.style.display="none";
    c1.style.display="none";
    d1.style.display="none";
    e1.style.display="none";
    f1.style.display="none";
    g1.style.display="none";
    h1.style.display="none";
    i1.style.display="none";
    k1.style.display="none";
    j1.style.display="none";
}
function b(){
    var a1 = document.getElementById("a1");
    var b1 = document.getElementById("b1");
    var c1 = document.getElementById("c1");
    var d1 = document.getElementById("d1");
    a1.style.display="none";
    b1.style.display="block";
    c1.style.display="none";
    d1.style.display="none";
    e1.style.display="none";
    f1.style.display="none";
    g1.style.display="none";
    h1.style.display="none";
    i1.style.display="none";
    j1.style.display="none";
    k1.style.display="none";
}
function c(){
    var a1 = document.getElementById("a1");
    var b1 = document.getElementById("b1");
    var c1 = document.getElementById("c1");
    var d1 = document.getElementById("d1");
    var j1 = document.getElementById("j1");
    var k1 = document.getElementById("k1");
    a1.style.display="none";
    b1.style.display="none";
    c1.style.display="block";
    d1.style.display="none";
    e1.style.display="none";
    f1.style.display="none";
    g1.style.display="none";
    h1.style.display="none";
    i1.style.display="none";
    j1.style.display="none";
    k1.style.display="none";
}
function d(){
    var a1 = document.getElementById("a1");
    var b1 = document.getElementById("b1");
    var c1 = document.getElementById("c1");
    var d1 = document.getElementById("d1");
    a1.style.display="none";
    b1.style.display="none";
    c1.style.display="none";
    d1.style.display="block";
    e1.style.display="none";
    f1.style.display="none";
    g1.style.display="none";
    h1.style.display="none";
    i1.style.display="none";
    j1.style.display="none";
    k1.style.display="none";
}
window.onload=a;
function e(){
    var a1 = document.getElementById("a1");
    var e1 = document.getElementById("e1");
    var f1 = document.getElementById("f1");
    var g1 = document.getElementById("g1");
    var h1 = document.getElementById("h1");
    var i1 = document.getElementById("i1");
    var b1_2 = document.getElementById("b1_2");
    var j1 = document.getElementById("j1");
    var k1 = document.getElementById("k1");
    k1.style.display="none";
    a1.style.display="none";
    b1_2.style.display="none";
    e1.style.display="block";
    f1.style.display="none";
    g1.style.display="none";
    h1.style.display="none";
    i1.style.display="none";
    j1.style.display="none";
}
function f(){
    var e1 = document.getElementById("e1");
    var f1 = document.getElementById("f1");
    var g1 = document.getElementById("g1");
    var h1 = document.getElementById("h1");
    var i1 = document.getElementById("i1");
    var b1_2 = document.getElementById("b1_2");
    var a1 = document.getElementById("a1");
    var j1 = document.getElementById("j1");
    var k1 = document.getElementById("k1");
    k1.style.display="none";
    a1.style.display="none";
    b1_2.style.display="none";
    e1.style.display="none";
    f1.style.display="block";
    g1.style.display="none";
    h1.style.display="none";
    i1.style.display="none";
    j1.style.display="none";
}
function g(){
    var e1 = document.getElementById("e1");
    var f1 = document.getElementById("f1");
    var g1 = document.getElementById("g1");
    var h1 = document.getElementById("h1");
    var i1 = document.getElementById("i1");
    var b1_2 = document.getElementById("b1_2");
    var a1 = document.getElementById("a1");
    var j1 = document.getElementById("j1");
    var k1 = document.getElementById("k1");
    k1.style.display="none";
    a1.style.display="none";
    b1_2.style.display="none";
    e1.style.display="none";
    f1.style.display="none";
    g1.style.display="block";
    h1.style.display="none";
    i1.style.display="none";
    j1.style.display="none";
}
function h(){
    var e1 = document.getElementById("e1");
    var f1 = document.getElementById("f1");
    var g1 = document.getElementById("g1");
    var h1 = document.getElementById("h1");
    var i1 = document.getElementById("i1");
    var b1_2 = document.getElementById("b1_2");
    var a1 = document.getElementById("a1");
    var j1 = document.getElementById("j1");
    var k1 = document.getElementById("k1");
    k1.style.display="none";
    a1.style.display="none";
    b1_2.style.display="none";
    e1.style.display="none";
    f1.style.display="none";
    g1.style.display="none";
    h1.style.display="block";
    i1.style.display="none";
    j1.style.display="none";
}
function i(){
    var e1 = document.getElementById("e1");
    var f1 = document.getElementById("f1");
    var g1 = document.getElementById("g1");
    var h1 = document.getElementById("h1");
    var i1 = document.getElementById("i1");
    var b1_2 = document.getElementById("b1_2");
    var a1 = document.getElementById("a1");
    var j1 = document.getElementById("j1");
    var k1 = document.getElementById("k1");
    k1.style.display="none";
    a1.style.display="none";
    b1_2.style.display="none";
    e1.style.display="none";
    f1.style.display="none";
    g1.style.display="none";
    h1.style.display="none";
    i1.style.display="block";
    j1.style.display="none";
}
function j(){
    var e1 = document.getElementById("e1");
    var f1 = document.getElementById("f1");
    var g1 = document.getElementById("g1");
    var h1 = document.getElementById("h1");
    var i1 = document.getElementById("i1");
    var j1 = document.getElementById("j1");
    var b1_2 = document.getElementById("b1_2");
    var a1 = document.getElementById("a1");
    var c1_1 = document.getElementById("c1_1");
    var k1 = document.getElementById("k1");
    k1.style.display="none";
    a1.style.display="none";
    b1_2.style.display="none";
    c1_1.style.display="none";
    e1.style.display="none";
    f1.style.display="none";
    g1.style.display="none";
    h1.style.display="none";
    i1.style.display="none";
    j1.style.display="block";
}
function k(){
    var e1 = document.getElementById("e1");
    var f1 = document.getElementById("f1");
    var g1 = document.getElementById("g1");
    var h1 = document.getElementById("h1");
    var i1 = document.getElementById("i1");
    var j1 = document.getElementById("j1");
    var b1_2 = document.getElementById("b1_2");
    var a1 = document.getElementById("a1");
    var c1_1 = document.getElementById("c1_1");
    var k1 = document.getElementById("k1");
    j1.style.display="none";
    a1.style.display="none";
    b1_2.style.display="none";
    c1_1.style.display="none";
    e1.style.display="none";
    f1.style.display="none";
    g1.style.display="none";
    h1.style.display="none";
    i1.style.display="none";
    k1.style.display="block";
}
$(function(){
    $(".a1").click(function(){
        $(this).css("background","#0099FF");
        $(this).css("color","#ffffff");
        $(".a1").not(this).css("background","#ffffff");
        $(".a1").not(this).css("color","#625D73");
    });
    $(".a2").click(function(){
        $(this).css("background","#0099FF");
        $(this).css("color","#F8F8F8");
        $(".a2").not(this).css("background"," #F8F8F8");
        $(".a2").not(this).css("color","#625D73");
    });
    $(".a3").click(function(){
        $(this).css("background","#0099FF");
        $(this).css("color","#F8F8F8");
        $(".a3").not(this).css("background"," #F8F8F8");
        $(".a3").not(this).css("color","#625D73");
    });
});